package org.singledog.form.builder.configuration;

import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

public class DataSetConfiguration {

    private static String datasetBaseDirectory;

    public static void setDatasetBaseDirectory(String directory) {
        Assert.notNull(directory, "config dataset directory can not be null !");

        if (!directory.endsWith("/")) {
            directory = directory.concat("/");
        }

        datasetBaseDirectory = directory;
    }

    public static String getDatasetBaseDirectory() {
        if (StringUtils.isEmpty(datasetBaseDirectory)) {
            return "dataset/";
        }

        return datasetBaseDirectory;
    }


}
